<template>
  <div class="table-page-search-wrapper">
    <el-form :model="searchForm" ref="searchForm" label-width="100px" class="demo-ruleForm">
      <el-row :gutter="10">
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="商品名称:">
            <a-input v-model="searchForm.goodsName" placeholder="请输入商品名称" />
          </el-form-item>
        </el-col>
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="商品条码:">
            <a-input v-model="searchForm.barCode" placeholder="请输入条码或后四位" />
          </el-form-item>
        </el-col>
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="商品编号:">
            <a-input v-model="searchForm.goodsId" placeholder="请输入商品编号" />
          </el-form-item>
        </el-col>
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="单据编号:">
            <a-input v-model="searchForm.inStockId" placeholder="请输入单据编号" />
          </el-form-item>
        </el-col>
        <!-- <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="制单时间:">
            <a-range-picker
              v-model="searchForm.zdsj"
              show-time
              style="width:100%"
              format="YYYY-MM-DD HH:mm:ss"
              @change="cxsjChange"
            />
          </el-form-item>
        </el-col> -->
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="入库状态:">
            <a-select v-model="searchForm.status" placeholder="请选择入库状态" style="width:100%">
              <a-select-option
                v-for="item in yetaiList"
                :key="item.value"
                :value="item.value"
              >{{item.label}}</a-select-option>
            </a-select>
          </el-form-item>
        </el-col>
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="创单人:">
            <a-input v-model="searchForm.operatorId" placeholder="请输入商品编号" />
          </el-form-item>
        </el-col>
        <el-col :md="6" :sm="12" :xs="24">
          <div style="margin-left:30px">
            <a-button type="primary" icon="search" @click="searchAction()">查询</a-button>
            <a-button icon="delete" @click="resetSearch()" style="margin-left: 8px;">重置</a-button>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'search',
  data() {
    return {
      zhuangtaiList: [
        {
          label: '停用',
          value: 0
        },
        {
          label: '启用',
          value: 1
        }
      ], //zhaungt
      yetaiList: [
        //商品业态
        {
          label: '待入库',
          value: "00"
        },
        {
          label: '部分入库',
          value: '01'
        },
        {
          label: '已完成',
          value: '02'
        }
      ],
      searchForm: {},
      djztList: []
    }
  },
  methods: {
    searchAction() {
      //执行搜索
      this.$emit('search')
    },
    resetSearch() {
      this.searchForm = {}
      this.$emit('resetSearch')
    },
    getSearchForm() {
      //获取高级搜索条件
      return {
        ...this.searchForm
      }
    },
    cxsjChange(e) {
      var timeList = [this.formDate(e[0]._d), this.formDate(e[1]._d)]
      this.searchForm.startCxsj = timeList[0]
      this.searchForm.endCxsj = timeList[1]
    }
  }
}
</script>


<style lang="less">
</style>>
